realtek: rtl931x: set hash_msb based on VLAN ID when adding a new L2 entry
authorIssam Hamdi <[email protected]>
Wed, 3 Sep 2025 12:19:38 +0000 (14:19 +0200)
committerRobert Marko <[email protected]>
Mon, 29 Sep 2025 18:55:22 +0000 (20:55 +0200)
commit36d8d19993c220198a81c0545b246eea496f4d1c
tree12a6d63bcfeb94e727c22b4aa9f383f082842d50
parent8c82e2dc93384caffab02aae3638c5b88d09731e
realtek: rtl931x: set hash_msb based on VLAN ID when adding a new L2 entry

During testing, we discovered that when adding a new offload FDB rule
on certain VLANs and then delete it, does not work as expected.

Steps to Reproduce:

* Create VLAN 4094 on the port lan1:

      bridge vlan add vid 4094 dev lan1 pvid

* Add a new FDB entry on port lan1 for VLAN 4094:

      bridge fdb add 00:01:02:22:33:44 dev lan1 vlan 4094 master permanent

* Delete the new FDB entry on port lan1 for VLAN4094

      bridge fdb del 00:01:02:22:33:44 dev lan1 vlan 4094 master permanent

Root Cause:

The failure occurs because the hash_msb flag is not set correctly
based on the VLAN ID when adding a new L2 entry.

Signed-off-by: Issam Hamdi <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20183
Signed-off-by: Robert Marko <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c